{include file='public/meta'}
<title>新增文章 - 资讯管理 - H-ui.admin v3.0</title>
<meta name="keywords" content="H-ui.admin v3.0,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.0，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<style>
  .dat,date{width:100px;}
  li{float:left;}
</style>
<body>
<article class="page-container">
  <form class="form form-horizontal" id="form-article-add" method='post' enctype="multipart/form-data">
    <div class="mt-20">
    <table class="table table-border table-bordered table-bg table-hover table-sort">
      <thead>
        <tr class="text-c">
          <th width="40">ID</th>
          <th width="60">会员名</th>
          <th>评论内容</th>
          <th>是否显示</th>
          <th>回复内容</th>
        </tr>
      </thead>
      <tbody>
        <tr class="text-c va-m">
          <td>{$v.id}</td>
          <td>{$v.nickname}</td>
          <td>{$v.content}...</td>
          <td class="td-manage">
            {if condition='$v.status == 0'}
            <a style="text-decoration:none" onClick="pin(this,'{$v.id}')" href="javascript:;">显示</a>
            <input type="hidden" value="1">
            {else}
            <a style="text-decoration:none" onClick="pin(this,'{$v.id}')" href="javascript:;">不显示</a>
            <input type="hidden" value="0">
            {/if} 
          </td>
          <td class="td-manage">
            {if condition='$v.huifu == ""'}
            <input type="text" name="huifu">
            <a style="text-decoration:none" onClick="pin2(this,'{$v.id}')" href="javascript:;">回复</a>
            {else}
            {$v.huifu}
            {/if} 
          </td>
        </tr>
      </tbody>
    </table>
    </div>
  </form>
</article>   

{include file='public/footer'}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>   
<script type="text/javascript" src="/static/lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript" src="/static/lib/ueditor/1.4.3/ueditor.config.js"></script> 
<script type="text/javascript" src="/static/lib/ueditor/1.4.3/ueditor.all.min.js"> </script> 
<script type="text/javascript" src="/static/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">

function pin(obj,id){
  var data = 'id='+id+'&caozuo='+$(obj).next().val();
  $.post('{:url('admin/club/do_pin')}',data,function(res){
    if(res.msg == '修改成功'){
      layer.msg(res.msg,{icon:1,time:1000},function(){location.reload()});
    }
  });
}

function pin2(obj,id){
  var data = 'id='+id+'&caozuo='+$('input[name=huifu]').val();
  $.post('{:url('admin/club/do_pin2')}',data,function(res){
    if(res.msg == '回复成功'){
      layer.msg(res.msg,{icon:1,time:1000},function(){location.reload()});
    }
  });
}

$(function(){
  $('.skin-minimal input').iCheck({
    checkboxClass: 'icheckbox-blue',
    radioClass: 'iradio-blue',
    increaseArea: '20%'
  });
  
  var ue = UE.getEditor('editor');
  
});

$().ready(function(){
    $('form').validate({
      submitHandler:function(form){
        $(form).ajaxSubmit({
          type:'post',
          url:'{:url('admin/club/club_add')}',
          dataType:'text',
          success:function(res){
            layer.msg('添加成功',{icon:1,time:2000},function(){
              location.reload();
            });
          }
        })
      }
    });
  })
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
